﻿ 

 
  function PhotoClick(obj) {
      var classPhotoID = $(obj).attr("classPhotoID");
      var url = window.location.href;
       url= App.AddQueryToUrl(url, "classPhotoID",classPhotoID);
      $(obj).attr("href",url);
  }
  function hotoDetails(obj) {
       $("#gallery").show();
       $("#albumWrap").hide();
      $("#page").hide();
       $("#photoComment").hide();
  }



 App.delPhoto = function (obj) {
     var photoName = $(obj).parent().prev().text();
     var photoID = $(obj).parent().parent().prev().find("img").attr("photoid");
     App.confirm("确定要删除\" " + photoName  + " \"这张照片吗？", function () {
        

         $.ajax({
             async: true,
             dataType: "json",
             data: { photoID: photoID },
             url: "/Ajax/DelPhoto/",
             cache: false,
             type: "post",
             success: function (o) {
                 if (o.Code == "A00018") {
                     $(obj).parent().parent().parent().remove();
                     App.fullTip("删除成功", 1000, null, 3);
                     return;
                 }
                 if (o.Code == "A00001") {
                     App.showLoginDial();
                     return;
                 }
                 if (o.Code == "A00003") {
                     App.alert(CodeList[o.Code]);
                     return;
                 }
             },
             error: function () {
                 App.alert(CodeList["A00003"]);
             }
         });
     });
 }

 App.delPhotoFolder = function (obj) {
     var photoName = $(obj).parent().prev().text();
     var photoID = $(obj).parent().parent().prev().find("img").attr("photoid");
     App.confirm("确定要删除\" " + photoName + " \"这张照片吗？<br />此分组下的人不会被取消关注。", function () {


         $.ajax({
             async: true,
             dataType: "json",
             data: { photoID: photoID },
             url: "/Ajax/DelPhoto/",
             cache: false,
             type: "post",
             success: function (o) {
                 if (o.Code == "A00018") {
                     $(obj).parent().parent().parent().remove();
                     App.fullTip("删除成功", 1000, null, 3);
                     return;
                 }
                 if (o.Code == "A00001") {
                     App.showLoginDial();
                     return;
                 }
                 if (o.Code == "A00003") {
                     App.alert(CodeList[o.Code]);
                     return;
                 }
             },
             error: function () {
                 App.alert(CodeList["A00003"]);
             }
         });
     });
 } 